package com.itheima.appserver;

import com.itheima.dubbo.api.MovementApi;
import com.itheima.model.mongo.Movement;
import org.apache.dubbo.config.annotation.DubboReference;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.ArrayList;
import java.util.List;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = AppServerApplication.class)
public class test3 {
    @DubboReference
    private MovementApi movementApi;

    @Test
    public void test() {
        Movement movement = new Movement();
        movement.setUserId(106l);
        movement.setTextContent("终是远方的星辰");
        List<String> list = new ArrayList<>();
        list.add("https://tanhuawsj.oss-cn-shenzhen.aliyuncs.com/2022/03/23/3f268860-3b4e-43c4-86fc-5ccfeaf7ea29.jpg");
        list.add("https://tanhuawsj.oss-cn-shenzhen.aliyuncs.com/2022/03/24/31cb30c8-cb03-422f-88c5-adc264c16ebb.jpg");
        movement.setMedias(list);
        movement.setLatitude("40.635");
        movement.setLongitude("116.2");
        movement.setLocationName("湖南长沙");
        movementApi.publish(movement);
    }

    @Test
    public void test2() {
        Long t1 = 123131213212313213L;
        Long t2 = 123131213212313213L;
        if (t1.toString() != t2.toString()) {
            System.out.println(123);
        }
    }
}
